package sdk.pay.easypermissions.helper;

import android.app.Activity;
import android.content.Context;
import android.support.v4.app.ActivityCompat;

class ActivityPermissionHelper extends PermissionHelper<Activity> {

    public ActivityPermissionHelper(Activity host) {
        super(host);
    }

    @Override
    public void requestPermissions(String rationale,
                                   int positiveButton,
                                   int negativeButton,
                                   int requestCode,
                                   String... perms) {

        ActivityCompat.requestPermissions(getHost(), perms, requestCode);
    }

    @Override
    public boolean shouldShowRequestPermissionRationale(String perm) {
        return ActivityCompat.shouldShowRequestPermissionRationale(getHost(), perm);
    }

    @Override
    public Context getContext() {
        return getHost();
    }
}
